include $(TOPDIR)/rules.mk

PKG_NAME:=ssd20x-lcd
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)
  SECTION:=SigmStar
  CATEGORY:=SigmStar
  SUBMENU:=utils
  DEPENDS:=@TARGET_sstar_ssd20x
  TITLE:=SSD201/SD202 LCD config
endef

define Package/$(PKG_NAME)-init
  SECTION:=SigmStar
  CATEGORY:=SigmStar
  SUBMENU:=utils
  DEPENDS:=@TARGET_sstar_ssd20x +ssd20x-lcd +ssd20x-mpp-lib
  TITLE:=SSD201/SD202 lcd init
endef

define Package/$(PKG_NAME)/description
 SSD20X LCD 
endef

define Package/$(PKG_NAME)-init/description
 SSD20X LCD init for QT
endef

define Package/$(PKG_NAME)/config
  source "$(SOURCE)/Config.in"
endef

SSTAR_LCD_DIR=$(CONFIG_SSD20X_LCD_NAME)

TARGET_CFLAGS += -D$(SSTAR_LCD_DIR)

MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/ssd20x"

define Package/$(PKG_NAME)/install
	$(CP) ./files/$(SSTAR_LCD_DIR)/* $(1)/
endef

define Package/$(PKG_NAME)-init/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ssd20x-lcd-init $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)-init))
